package com.example.poverty.service.impl;

import com.example.poverty.dao.PopulationFlowMapper;
import com.example.poverty.entity.PopulationFlow;
import com.example.poverty.service.PopulationFlowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 流动人口 实现接口实现类
 */
@Service
public class PopulationFlowServiceImpl implements PopulationFlowService {

    @Autowired
    private PopulationFlowMapper populationFlowMapper;

    @Override
    public boolean insert(PopulationFlow populationFlow) {
        return populationFlowMapper.insert(populationFlow) > 0;
    }

    @Override
    public boolean update(PopulationFlow populationFlow) {
        return populationFlowMapper.update(populationFlow) > 0;
    }

    @Override
    public boolean delete(Integer id) {
        return populationFlowMapper.delete(id) > 0;
    }

    @Override
    public PopulationFlow selectByPrimaryKey(Integer id) {
        return populationFlowMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<PopulationFlow> allPopulationFlow() {
        return populationFlowMapper.allPopulationFlow();
    }

    @Override
    public PopulationFlow getByName(String name) {
        return populationFlowMapper.getByName(name);
    }
}
